/*这个文件是angular根模块， 告诉angular如何组装应用*/ 
// BrowserModule, 浏览器解析的模块
import { BrowserModule } from '@angular/platform-browser';
// angular 核心模块
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'   // 表单模块
// 根组件
import { AppComponent } from './app.component';

// 引入http 模块
import {HttpClientModule} from '@angular/common/http'

// 引入服务
import { StorageService } from './services/storage.service';
import {RequestService} from './services/request.service'
// 组件
import { NewsComponent } from './components/news/news.component';
import { HomeComponent } from './components/home/home.component';
import { FormComponent } from './components/form/form.component';

import { DemoComponent } from './components/demo/demo.component';
import { HeaderComponent } from './components/header/header.component';
import { TranstionComponent } from './components/transtion/transtion.component';
import { PropComponent } from './components/prop/prop.component';
import { FooterComponent } from './components/footer/footer.component';
import { LifeCycleComponent } from './components/life-cycle/life-cycle.component';
import { SyncComponent } from './components/sync/sync.component';
import { HttpComponent } from './components/http/http.component';



// @NgModule装饰器，@NgModule接收一个元数据对象，告诉angular如何编译和启动应用
@NgModule({
  declarations: [     // 配置当前项目运行的根组件, 声明
    AppComponent, NewsComponent, HomeComponent, FormComponent, DemoComponent, HeaderComponent, TranstionComponent, PropComponent, FooterComponent, LifeCycleComponent, SyncComponent, HttpComponent
  ],
  imports: [          // 配置当前模块运行依赖的其他模块
    BrowserModule,
    FormsModule,
    HttpClientModule
  ],
  providers: [StorageService, RequestService],                // 配置项目所需要的服务
  bootstrap: [AppComponent]    // 指定应用的主视图（称为根组件） 通过引导根AppModule来启动应用，这里一般写根组件
})
// 根模块不需要导出任何东西， 因为其他组件不需要导入根模块
export class AppModule { }
